<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<!-- 

定义class：定义一个表示矩形的class，包含宽度和高度两个属性，以及计算面积和周长的方法。


-->
<script>
    class JuXing {
        constructor(weight, height) {
            this.weight = weight;
            this.height = height;
        }
        Mj() {
            var mj = (this.weight * this.height);
            return mj
        }
        Zc() {
            var zc = (this.weight + this.height) * 2;
            return zc
        }
    }
    var J = new JuXing(4, 5)
    console.log(J.Mj());
    console.log(J.Zc());

</script>

</html>